//
//  GKZYSortView.m
//  GKZYAid
//
//  Created by tony on 16/2/27.
//  Copyright © 2016年 GKZYAid. All rights reserved.
//

#import "GKZYSortView.h"
#import "MyDefine.h"

@implementation GKZYSortView


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self addViews];
    }
    return self;
}

-(void)addViews{
    
    UILabel *label1 = [[UILabel alloc]init];
    label1.frame = CGRectMake(0, VIEWHEIGHT/7, VIEWWIDTH, 20);
    label1.text = @"查分系统";
    label1.textAlignment = NSTextAlignmentCenter;
    [self addSubview:label1];
    
    self.scoreInquireItem = [[GKZYSortItemView alloc]initWithFrame:CGRectMake(60, CGRectGetMaxY(label1.frame)+VIEWHEIGHT/25, (VIEWWIDTH - 150)/3.0, (VIEWWIDTH - 150)*1.3/3.0)];
    [self.scoreInquireItem setItemsImage:[UIImage imageNamed:@"school-info01@3x"] andItemsName:@"查询分数"];
    [self addSubview:self.scoreInquireItem];
    
    self.passSoreItem = [[GKZYSortItemView alloc]initWithFrame:CGRectMake(VIEWWIDTH - 60 - CGRectGetWidth(self.scoreInquireItem.frame), CGRectGetMinY(self.scoreInquireItem.frame), (VIEWWIDTH - 150)/3.0, (VIEWWIDTH - 150)*1.3/3.0)];
    [self.passSoreItem setItemsImage:[UIImage imageNamed:@"school-info02@3x"] andItemsName:@"批次查询"];
    [self addSubview:self.passSoreItem];
    
    UIImageView *image = [[UIImageView alloc]initWithFrame:CGRectMake(20,CGRectGetMaxY(self.passSoreItem.frame)+VIEWHEIGHT/25 , VIEWWIDTH - 40, (VIEWWIDTH-40)*0.27)];
    image.image = [UIImage imageNamed:@"plane"];
    [self addSubview:image];
    
    UILabel *label2 = [[UILabel alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(image.frame)+VIEWHEIGHT/25, VIEWWIDTH, 20)];
    label2.text = @"志愿辅助查询";
    label2.textAlignment = NSTextAlignmentCenter;
    [self addSubview:label2];
    
    self.projectItem = [[GKZYSortItemView alloc]initWithFrame:CGRectMake(40, CGRectGetMaxY(label2.frame)+VIEWHEIGHT/25, (VIEWWIDTH - 150)/3.0, (VIEWWIDTH - 150)*1.3/3.0)];
    [self.projectItem setItemsImage:[UIImage imageNamed:@"school-info05@3x"] andItemsName:@"专业查询"];
    [self addSubview:self.projectItem];
    
    self.schoolItem = [[GKZYSortItemView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.projectItem.frame)+35, CGRectGetMinY(self.projectItem.frame), (VIEWWIDTH - 150)/3.0, (VIEWWIDTH - 150)*1.3/3.0)];
    [self.schoolItem setItemsImage:[UIImage imageNamed:@"school-zyinfo02@3x"] andItemsName:@"学校查询"];
    [self addSubview:self.schoolItem];
    
    self.hotSortItem = [[GKZYSortItemView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.schoolItem.frame)+35, CGRectGetMinY(self.schoolItem.frame), (VIEWWIDTH - 150)/3.0, (VIEWWIDTH - 150)*1.3/3.0)];
    [self.hotSortItem setItemsImage:[UIImage imageNamed:@"school-lgk@3x"] andItemsName:@"热门排行"];
    [self addSubview:self.hotSortItem];
    
}




/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
